package com.ruoyi.system.service.impl;

import java.util.List;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.system.domain.LAccount;
import com.ruoyi.system.mapper.LAccountMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.LExebilldetailMapper;
import com.ruoyi.system.domain.LExebilldetail;
import com.ruoyi.system.service.ILExebilldetailService;

import static com.ruoyi.common.utils.SecurityUtils.getUserId;

/**
 * 派工单明细Service业务层处理
 *
 * @author zyb
 * @date 2022-01-02
 */
@Service
public class LExebilldetailServiceImpl extends ServiceImpl<LExebilldetailMapper, LExebilldetail> implements ILExebilldetailService {


    /**
     * 查询派工单明细
     *
     * @param id 派工单明细主键
     * @return 派工单明细
     */
    @Override
    public LExebilldetail selectLExebilldetailById(Long id) {
        return baseMapper.selectLExebilldetailById(id);
    }

    /**
     * 查询派工单明细列表
     *
     * @param lExebilldetail 派工单明细
     * @return 派工单明细
     */
    @Override
    public List<LExebilldetail> selectLExebilldetailList(LExebilldetail lExebilldetail) {
        return baseMapper.selectLExebilldetailList(lExebilldetail);
    }

    /**
     * 新增派工单明细
     *
     * @param lExebilldetail 派工单明细
     * @return 结果
     */
    @Override
    public int insertLExebilldetail(LExebilldetail lExebilldetail) {
        lExebilldetail.setCreateBy(String.valueOf(getUserId()));
        lExebilldetail.setCreateTime(DateUtils.getNowDate());
        return baseMapper.insertLExebilldetail(lExebilldetail);
    }

    /**
     * 修改派工单明细
     *
     * @param lExebilldetail 派工单明细
     * @return 结果
     */
    @Override
    public int updateLExebilldetail(LExebilldetail lExebilldetail) {
        lExebilldetail.setUpdateBy(String.valueOf(getUserId()));
        lExebilldetail.setUpdateTime(DateUtils.getNowDate());
        return baseMapper.updateLExebilldetail(lExebilldetail);
    }

    /**
     * 批量删除派工单明细
     *
     * @param ids 需要删除的派工单明细主键
     * @return 结果
     */
    @Override
    public int deleteLExebilldetailByIds(Long[] ids) {
        return baseMapper.deleteLExebilldetailByIds(ids);
    }

    /**
     * 删除派工单明细信息
     *
     * @param id 派工单明细主键
     * @return 结果
     */
    @Override
    public int deleteLExebilldetailById(Long id) {
        return baseMapper.deleteLExebilldetailById(id);
    }
}
